/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package helper;

import dbconnector.DBDriver;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

/**
 *
 * @author HONEY
 */
public class AdminHelper
{
   public static AO.Admin getAdminBean(String username,String password)
   {
        try{
         PreparedStatement p= DBDriver.getPrepare("select * from admin where username=? and password=?");
         p.setString(1, username);
         p.setString(2, password);
         ResultSet rs=p.executeQuery();
         if(rs.next())
                 {
                     AO.Admin a=new AO.Admin();
                     a.setUsername(username);
                     a.setPassword(password);
                     return a;
                 }
         return null;
        }
        catch(Exception e){return null;}
   }
           
}
